package com.daedalus.Polimorfizmi.Shapes;

import java.awt.Color;
import java.awt.Graphics;


public class MyRectangle extends MyShape{

	int width;
	int height;
	
	public MyRectangle(int x, int y, int w, int h) {
		super(x, y);
		setWidth(w);
		setHeight(h);
	}

	public void setWidth(int x){
		width=x>0?x:10;
	}
	public void setHeight(int y){
		height=y>0?y:10;
	}
	public int getGjeresia(){
		return height;
	}
	public int getLartesia(){
		return width;
	}
	
	@Override
	public void paint(Graphics g) {
		g.setColor(Color.blue);
		g.fillRect(getX(), getY(), getLartesia(), getGjeresia());
		
	}

}
